package com.azh.server.vm;

import com.azh.server.datam.DataManager;
import com.azh.server.tx.TxManager;

/**
 * @author zhaozhenhang <zhaozhenhang@kuaishou.com>
 * Created on 2022-04-30
 */
public interface VersionManager {

    public byte[] read(long txId, long uid) throws Exception;

    public long insert(long txId, byte[] data) throws Exception;

    public boolean delete(long txId, long uid) throws Exception;

    public long begin(int level);

    public void commit(long txId) throws Exception;

    public void abort(long txId);

    public static VersionManager newVersionManager(TxManager tx, DataManager dm) {
        return new VersionManagerImpl(tx, dm);
    }
}
